<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../00-source/jquery.min.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            width: 100%;
            height: 100%;
        }
        ul{
            width: 100%;
            height: 100%;
            list-style: none;
            display: flex ;
        }
        ul>li{
            width: 25%;
            height: 100%;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }
        ul>li:nth-child(1){
            background-image: url(../00-source/imgs/1.jpg);
        }
        ul>li:nth-child(2){ 
            background-image: url(../00-source/imgs/2.jpg);
        }
        ul>li:nth-child(3){
            background-image: url(../00-source/imgs/4.jpg);
        }
        ul>li:nth-child(4){
            background-image: url(../00-source/imgs/6.jpg);
        }
    </style>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <script>
        // 注意一定要养成在动画之前先调用stop()，防止出现鼠标已经停止操作，但是动画还在播放的情况
        $('ul>li').mouseover(function(){
            $(this).siblings().stop().animate({
                width:document.documentElement.clientWidth*0.07
            },500)
            $(this).stop().animate({
                width:document.documentElement.clientWidth*0.8,
            },500)
        })

        $(document).mouseleave(function(){
            $('ul>li').stop().animate({
                width:document.documentElement.clientWidth*0.25
            })
        })
    </script>
</body>
</html>